<?php
include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/nn_logic/nl_common.func.php';
include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'import_assets_proc.class.php';
define("IMPORT_SOURCE", "mgtv");
$dc = nl_get_dc(
	array (
			"db_policy" => NL_DB_WRITE,
			"cache_policy" => NP_KV_CACHE_TYPE_MEMCACHE
));
$cp_id = 'gzgd';
$result_cp = nl_cp::query_by_id_by_db($dc->db(),$cp_id);
$cp_config = isset($result_cp['data_info']['nns_config']) && !empty($result_cp['data_info']['nns_config']) ? json_decode($result_cp['data_info']['nns_config'], true) : null;
$import = new import_assets_class($cp_config);
$import->dc = $dc;

$params = array(
	'assets_file_info' => '<media file_id="AVIT0120170803000892" file_type="ts" file_name="爆裂飞车第2季第16集" file_path="ftp://amftp:amftp123@ftp.am.jmxxb:21/527912.ts" file_definition="hd" file_resolution="" file_desc="" file_size="1" file_bit_rate="" file_time_len="1380" FrameRate="" file_hash="" asset_source="gzgd" drm_enabled="0"/>',
	'func' => 'import_video_file',
	'assets_id' => 'OTHE6720170802001761',
	'assets_video_type' => 0,
	'assets_clip_id' => 'OTHE6720170802001761',
	'assets_file_id' => 'AVIT0120170803000892',
	'message_id' => '4017680',
);
$re = $import->import_video_file($params);

// $params = array(
	// 'assets_clip_info' => '<index clip_id="OTHE6720170802001761" name="爆裂飞车第2季第16集" index="15" time_len="1380" summary="《爆裂飞车2》是爆裂飞车系列的第二部作品，是一部充满戏剧色彩、科普宇宙知识、宣扬环保精神的科幻冒险类动画电视系列剧。很久以前，幽冥星战士罗煞为了掌控宇宙，与其余12位星座战士展开激战，最后罗煞被打败陷入沉睡。" director="王薇" player="王薇" update_time="2016-1-1 00:00:00" release_time="2016-1-1 00:00:00" caption_language="中文简体" language="" region="" year="2016" asset_source="gzgd" pic=""/>',
	// 'func' => 'modify_video',
	// 'assets_id' => 'OTHE6720170802001761',
	// 'assets_clip_id' => 'OTHE6720170802001761',
	// 'assets_video_type' => 0,
	// 'message_id' => '4017680',
// );
// $re = $import->import_video_clip($params);

// $params = array(
	// 'assets_video_info' => '<video assets_id="OTHE6720170802001761" assets_category="动漫" video_type="0" view_type="3" name="爆裂飞车第2季第16集" director="王薇" player="王薇" tag="" region="" release_time="2016-1-1 00:00:00" sreach_key="" totalnum="26" national="" horizontal_img="" verticality_img="" smallpic="" intro="《爆裂飞车2》是爆裂飞车系列的第二部作品，是一部充满戏剧色彩、科普宇宙知识、宣扬环保精神的科幻冒险类动画电视系列剧。很久以前，幽冥星战士罗煞为了掌控宇宙，与其余12位星座战士展开激战，最后罗煞被打败陷入沉睡。" producer="10040" adaptor="" subordinate_name="" caption_language="中文简体" language="" initials="" view_len="" year="2016" asset_source="gzgd"/>',
	// 'func' => 'modify_video',
	// 'assets_id' => 'OTHE6720170802001761',
	// 'assets_video_type' => 0,
	// 'message_id' => '4017680',
// );
// $re = $import->modify_asset($params);

var_dump($re);die;